Use of printer
Morefun devices has an integrated printer and the SDK provides 2 method for using it in SDKMoreFunPrinter
class:
fun print(fileWrapper: SDKFileWrapper, callback: SDKMoreFunPrinterCallback)
This method allows to print a PNG format file wrapped in the fileWrapper argument. The fileWrapper
can be an
instance of SDKFileWrapper.Asset or a SDKFileWrapper.File class.
fun print(bitmap: Bitmap, callback: SDKMoreFunPrinterCallback)
This method allows to print a PNG format file represented in bitmap
argument. The bitmap is an instance of Bitmap
class.
Both method receive an instance of SDKMoreFunPrinterCallback
as second argument. This is an interface with 2
callback function to be implemented:
fun onSuccess()
This function will be called in case of successfully printing.
fun onError(error: SDKMoreFunPrinterError)
This function will be called in case of an error. The type of error are
listed in SDKMoreFunPrinterError
class.
For both options the PNG image must be at most 384 pixels wide.